/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sistemataller;

import java.awt.*;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import javax.swing.*;

public class Escritorio extends javax.swing.JDesktopPane {

    private Image image = null;
    private Image newimage = null;
    private ImageIcon icon=null;
    public Escritorio() {
        Dimension pantalla = Toolkit.getDefaultToolkit().getScreenSize();
        int height = pantalla.height;
        int width = pantalla.width;
        setSize(width, height);


        try {




            icon = new ImageIcon("/images/fondo.jpg");
            image = icon.getImage();
            
            
            newimage =image.getScaledInstance(159, 207, Image.SCALE_SMOOTH);


        } catch (Exception e) {
            System.out.println("Could not find file in folder: " + this.getClass().getResource("."));
        }

    }

    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2d = (Graphics2D) g;
        g2d.drawImage(newimage, 0, 0, getSize().width, getSize().height, this);
        System.out.println(""+getSize().width+" "+getSize().height);

    }
}
